The NerdWorld Report J. R. Casey Bralla 377 Farmview Drive East Earl, PA 17519 610-810-7716 |
Technology, Religion, Politics
and The Mind-Body Dualism Problem |
JRC-65 Computer
Tech Info
Essays
Site Hosted by
Vorlon Information Technologies
Entire site Copyright © 2024 by J. R. Casey Bralla
(except for obvious external works).
All rights reserved.
NOTE: If you link to this site,
or otherwise find it useful,
please send a brief note to the author.
One of the prime objectives of this design is the ability to really see what is happening on a CPU level. This means I want to be able to see when the CPU fetches data. I also want to see where the data comes from (which address and which chip), as well as the actual retrieved data itself. At normal CPU speeds (even for the venerable 6502), this happens way too fast for the human eye to see. I therefore want to be able to slow the system clock down enough to make these processes clearly visible. But a clock so slow would make the system unusable, so the clock has to be variable and able to run at "normal" speeds also so that it has at least some functionality. [OK, this system will never be "practical", but it's gotta run like a 1980's computer would run.]
Ben Eater's 6502 kit offers a separate variable-speed clock module using a 555 timer and a potentiometer to control the speed.
Ben's concept is simple and effective in that it allows the CPU to run very slowly or at full speed with just a twist of a dial. He also added the ability to stop/start and single-step the CPU clock. In addition to slow speeds, these functions are also critical to being able to watch the internal workings of the computer.But I wanted a few more bells and whistles. Firstly, I wanted to be able to instantly and precisely set the CPU clock to a known frequency. (No infinitely-variable twisty knobs for me.) Secondly, I wanted to always know exactly how fast the clock was running. I needed some type of read-out of the current speed.
The solution I decided upon was to use an Arduino as the clock generator. I originally planned to use the Arduino's on-board timers to directly generate the clock signal. But this idea proved to be impractical. For one thing, the Arduino's clock rate of 16 MHz meant that it would have a hard time flipping an output bit at up to 14 MHz. (It would need an internal clock of at least 28 MHz to do this, and then would need a few MHz just to allow for the Arduino to keep up with it's internal systems.) So I elected to use an AD9833 signal generator. These interface well with Arduinos and can generate anything from 0.1 Hz up to 25 MHz. This lets us go dead-slow, but also leaves some headroom above the 6502's max rated speed of 14 MHz. (Maybe I will be able to overclock this beast!) The AD9833 required 3 I/O pins from the Arduino.
To display the current frequency, I chose a standard 16-character x 2-line LCD module. These also easily integrate with the Arduino, taking 6 Arduino I/O pins. I wrote a simple Arduino sketch to display the current clock speed whenever it is changed.
I will use 8 Arduino I/O bits for momentary-contact push buttons to change the speed. I want buttons for:
I also wanted some type of "heartbeat" indicator from the Nano. I wanted this for 3 reasons:
The circuit diagram for the clock is shown here.
The Arduino sketch can be downloaded here.
Click here to download a high definition copy of the video at the top of the page.
Read Part 0 of this series for general information and design objectives.
Stay Tuned for Part 3 of this series, where I breadboard the basic CPU setup and watch the LEDs blink a bit.